package cn.watson.basic.utils;

import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.Data;

@Data
public class AjaxResult {

    // 返回操作成功
    public Boolean success = true;
    // 提示语句
    public String msg = "操作成功！！！";

    /**
    * @Title: me
    * @Description: 提供一个实列化对象的方法，不管是否成功，都会创建
    * @Author: ZhangRui
    * @Version: 1.0
    * @Date:  2022/6/24 11:04  
    * @Parameters: []
    * @Return cn.watson.basic.utils.AjaxResult
    */
    public static AjaxResult me(){
        return new AjaxResult();
    }

    /**
    * @Title: setsuccess
    * @Description: 提供set方法，为链式编程调用
    * @Author: ZhangRui
    * @Version: 1.0
    * @Date:  2022/6/24 11:06
    * @Parameters: [success]
    * @Return cn.watson.basic.utils.AjaxResult
    */
    public AjaxResult setsuccess(Boolean success){
        this.success = success;
        return this;
    }

    /**
    * @Title: setMsg
    * @Description: 提供set方法，为链式编程调用
    * @Author: ZhangRui
    * @Version: 1.0
    * @Date:  2022/6/24 11:08
    * @Parameters: [msg]
    * @Return cn.watson.basic.utils.AjaxResult
    */
    public AjaxResult setMsg(String msg){
        this.msg = msg;
        return this;
    }

}
